package net.cyndeline.gameMap

/**
 * Stores map data in an array.
 *
 * @param width Width of map.
 * @param height Height of map.
 */
class GridMap(val width: Int, val height: Int) extends Grid {
  if (width < 1 || height < 1) throw new IllegalArgumentException("Map height and width must be 1 or higher.")

  val mapArray = Array.fill[TileContents](width, height) { new TileContents() }

  override def tile(x: Int, y: Int): TileContents = mapArray(x)(y)
}
